package com.atguigu.rabbitmq.springbootmq.consumer;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ConfirmConsumer {
    public static final String QUEUE_NM="confirm.queue";

    @RabbitListener(queues = QUEUE_NM)
    public void receiveMsg(Message message){
        String msg=new String(message.getBody());
        log.info("====队列："+QUEUE_NM+"收到消息："+msg);
    }
}
